@extends('layouts.app')

@section('content')
    <section class="content-header">
        <h1>
            修改
        </h1>
   </section>
   <div class="content">
       @include('adminlte-templates::common.errors')
       <div class="box box-primary">
           <div class="box-body">
               <div class="row">
                   {!! Form::model($config, ['route' => ['configs.value_update', $type], 'method' => 'post', 'files'=>true]) !!}


                   <div class="form-group col-sm-12">
                       {!! Form::submit('Save', ['class' => 'btn btn-primary']) !!}
                       <a href="{!! route('configs.value_update',['type'=>$type]) !!}" class="btn btn-default">取消</a>
                   </div>
                   @if($type=='company_pic')
                        @tpic($config->value)
                       <div class="form-group col-sm-6">
                           {!! Form::label('pic', '封面图片:') !!}
                           {!! Form::file('pic') !!}
                       </div>
                   @elseif($type=='company_content')
                       <div class="form-group col-sm-12">
                           {!! Form::label('value', '公司风采内容:' ,['class'=>'ml15']) !!}
                           {!! Form::textarea('value', null, ['class' => 'company_content','id' => 'company_content']) !!}
                       </div>
                   @endif

                   {!! Form::close() !!}
               </div>
           </div>
       </div>
   </div>
@endsection

<style>
    #company_content{
        display: block;
        width: 96%;
        height: 600px;
        padding: 0;
    }
    .mt150{
        margin-top: 150px;
    }
    .mt15{
        margin-top: 15px;
    }
    .ml15{
        margin-left: 15px;
    }
</style>


@section('scripts')
    @include('vendor.ueditor.assets')

    <script type="text/javascript">
        $(document).ready(function() {
            var ue = UE.getEditor('company_content');
            ue.ready(function () {
                ue.execCommand('serverparam', '_token', '{{ csrf_token() }}'); // 设置 CSRF token.
            });
        });
    </script>
@endsection